/**************************************************************************/
/* Copyright (C) School of Software Engineering of USTC, 2012             */
/*                                                                        */
/*  FILE NAME: tchdbex.c                                                  */
/*  PRINCIPAL AUTHOR: SA12226114(Xin Zhu), SA12226139(Dan Shu)            */
/*  SUBSYSTEM NAME: DB                                                    */
/*  MODULE NAME: dbapi                                                    */
/*  LANGUAGE: C                                                           */
/*  TARGET ENVIRONMENT: Linux                                             */
/*  DATE OF FIRST RELEASE: 2012-11-27                                     */
/*  DESCRIPTION: Impement of Abstract Interface for Tokyo Cabinet DB API  */
/**************************************************************************/


#include "dbapi.h"



/*****************************************************************
Function Name: main
Description: This is a main function which schedules various operation for db
Parameter:  
@argc: argument count
@argv: argument vector

Author: SA12226114(Xin Zhu), SA12226139(Dan Shu)
Date: 2012-11-27
******************************************************************/
int main(int argc, char **argv)
{
    void *db;

    /* create the db object */
    db = db_new();

    /* open the database */
    db_open(db);

    /* store records */
    db_write(db, "ML", "Machine Learning");

    /* retrieve records */
    db_read(db, "ML");

    /* close the database */
    db_close(db);
    
    /* delete the object */
    db_delete(db);

    return 0;
}


